$OpenBSD: patch-aclocal_m4,v 1.5 2013/10/22 11:34:09 zhuk Exp $
--- aclocal.m4.orig	Wed Nov 26 22:24:01 2003
+++ aclocal.m4	Wed Oct  9 20:59:32 2013
@@ -556,11 +556,11 @@ AC_DEFUN(KDE_SUBST_PROGRAMS,
         if test -n "$MEINPROC" && test ! "$MEINPROC" = "compiled"; then  
  	    kde_sharedirs="/usr/share/kde /usr/local/share /usr/share /opt/kde3/share /opt/kde/share $prefix/share"
             test -n "$KDEDIR" && kde_sharedirs="$KDEDIR/share $kde_sharedirs"
-            AC_FIND_FILE(apps/ksgmltools2/customization/kde-chunk.xsl, $kde_sharedirs, KDE_XSL_STYLESHEET)
+            AC_FIND_FILE(apps.kde3/ksgmltools2/customization/kde-chunk.xsl, $kde_sharedirs, KDE_XSL_STYLESHEET)
 	    if test "$KDE_XSL_STYLESHEET" = "NO"; then
 		KDE_XSL_STYLESHEET=""
 	    else
-                KDE_XSL_STYLESHEET="$KDE_XSL_STYLESHEET/apps/ksgmltools2/customization/kde-chunk.xsl"
+                KDE_XSL_STYLESHEET="$KDE_XSL_STYLESHEET/apps.kde3/ksgmltools2/customization/kde-chunk.xsl"
 	    fi
         fi
 
@@ -6722,8 +6722,8 @@ nto-qnx)
 
 openbsd*)
   version_type=sunos
-  need_lib_prefix=no
-  need_version=no
+  need_lib_prefix=yes
+  need_version=yes
   library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
   finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
   shlibpath_var=LD_LIBRARY_PATH
@@ -7399,6 +7399,7 @@ openbsd*)
   else
     lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library'
   fi
+  lt_cv_deplibs_check_method=pass_all
   ;;
 
 osf3* | osf4* | osf5*)
@@ -8152,6 +8153,16 @@ case $host_os in
   netbsd*)
     # NetBSD uses g++ - do we need to do anything?
     ;;
+  openbsd*)
+    _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+    _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+
+    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R$libdir'
+    _LT_AC_TAGVAR(remove_libsearchpath, $1)='yes'
+    _LT_AC_TAGVAR(remove_lgcc, $1)='yes'
+    ;;
   osf3*)
     case $cc_basename in
       KCC)
@@ -8466,15 +8477,24 @@ if AC_TRY_EVAL(ac_compile); then
 	   else
 	     _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${_LT_AC_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
 	   fi
+	   if test "x$_LT_AC_TAGVAR(remove_libsearchpath, $1)" = "xyes"; then
+	     _LT_AC_TAGVAR(compiler_lib_search_path, $1)=""
+	   fi
 	   ;;
 	 # The "-l" case would never come before the object being
 	 # linked, so don't bother handling this case.
 	 esac
        else
+         add="${prev}$p"
+	 if test "x$_LT_AC_TAGVAR(remove_lgcc, $1)" = "xyes"; then
+	   case "$add" in
+	     -lgcc ) add="" ;;
+	   esac
+	 fi
 	 if test -z "$_LT_AC_TAGVAR(postdeps, $1)"; then
-	   _LT_AC_TAGVAR(postdeps, $1)="${prev}${p}"
+	   _LT_AC_TAGVAR(postdeps, $1)="$add"
 	 else
-	   _LT_AC_TAGVAR(postdeps, $1)="${_LT_AC_TAGVAR(postdeps, $1)} ${prev}${p}"
+	   _LT_AC_TAGVAR(postdeps, $1)="${_LT_AC_TAGVAR(postdeps, $1)} ${add}"
 	 fi
        fi
        ;;
@@ -10264,22 +10284,9 @@ EOF
       _LT_AC_TAGVAR(hardcode_direct, $1)=yes
       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
 
-      if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-	_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $linker_flags'
-	_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
-	_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
-      else
-       case $host_os in
-	 openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
-	   _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
-	   _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
-	   ;;
-	 *)
-	   _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $linker_flags'
-	   _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
-	   ;;
-       esac
-      fi
+      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R$libdir'
       ;;
 
     os2*)
@@ -10288,6 +10295,7 @@ EOF
       _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
       _LT_AC_TAGVAR(archive_cmds, $1)='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
       _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+    _LT_AC_TAGVAR(remove_lgcc, $1)='yes'
       ;;
 
     osf3*)
